// import React, { Component } from 'react';
import '../scss/login.css'
import { useNavigate } from 'react-router-dom'
import {useState} from 'react'
const Login = () => {
    const [use, setuser] = useState({
        number: '',
        psaa: ''
    })
    //登录
    const navigate = useNavigate()
    const denglu = (e) => {
        console.log(use)
        sessionStorage.setItem('number',use.number)
        navigate('/home')
    }
    //账号
    const number = (e) => {
        setuser({
            ...use, number: e.target.value
        })
    }
    //密码
    const pass = (e) => {
        setuser({
            ...use, pass: e.target.value
        })
    }
    return (
        <div className='login'>
            <div className='kuang'>
                <div className='wenzi'>账号登录</div>
                <input type="text" placeholder='账号' onChange={number} value={use.number} />
                <input type="text" placeholder='密码' onChange={pass} value={use.usepass} />
                <br></br>
                <button onClick={denglu}>登录</button>
            </div>

        </div>
    );
}

export default Login;